from flask_wtf import FlaskForm
from wtforms import StringField,PasswordField
from wtforms.validators import DataRequired, Length, EqualTo


class LoginForm(FlaskForm):
    """登录表单"""
    uesrname = StringField('账号', validators=[DataRequired(), Length(min=3, max=16)])
    password = PasswordField('密码', validators=[DataRequired()])


class RegistrationForm(FlaskForm):
    """注册表单"""
    uesrname = StringField('账号', validators=[DataRequired(), Length(min=3, max=16)])
    password = PasswordField('密码', validators=[DataRequired()])
    confirm_password = PasswordField('密码确认', validators=[DataRequired(), EqualTo('password')])
    display_name = StringField('名称', validators=[DataRequired()])
